<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.io.*,java.util.*,java.sql.*" %>
<%@ page import="javax.servlet.http.*,javax.servlet.*" %>
<%@ page import="catcatcat.*" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript">

</script>
</head>
<body>
<h1>使用 GET读取数据</h1>
<ul>
<li><p><b>用户名：</b>
   <%= request.getParameter("useid")%>
</p></li>
<li><p><b>您输入的密码：</b>
   <%= request.getParameter("pw")%>
</p></li>
</ul>

<%
   		CaoZuoSql caoZuoSql=new CaoZuoSql();
		String pwd=request.getParameter("pw").trim();
		String pwsd=caoZuoSql.chaXunPwsd(request.getParameter("useid")).trim();
		out.println("获取的密码="+pwsd);
		caoZuoSql.guanBi();
		if(pwd.equals(pwsd)){
			out.println("<p>登录结果：<span id='jieGuo'>登录成功</span></p>");
		}else if(!pwd.equals(pwsd)){
			out.println("<p>登录结果：<span id='jieGuo'>登录失败</span></p>");
		}else{
			out.println("<p>登录结：<span id='jieGuo'>位置错误</span></p>");
		}
			// 重定向到新地址
		   //String site = new String("../index.html");
		   //response.setStatus(response.SC_MOVED_TEMPORARILY);
		   //response.setHeader("Location", site); 			
%>

<p>页面倒计时：<span id="daoJiShi">1</span> </p>
</body>
</html>